﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<Ditto.Models.Transaction>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Details
</asp:Content>

<asp:Content ID="details" ContentPlaceHolderID="MainContent" runat="server">

    <div id="itemDiv" class="vevent">
    (Under Construction)
        <div class="widget">

            <h2>Transaction</h2>

            <p>
                <%: Html.DisplayFor(model => model.Item.Title) %>
            </p>

            <h3>Pickup Details</h3>

            <p>
                <%: Html.LabelFor(model => model.PickupAddress )%>
                <%: Html.DisplayFor(model => model.PickupAddress) %>
            </p>

            <p>
                <%: Html.LabelFor(model => model.PickupTime) %>
                <%: Html.DisplayFor(model => model.PickupTime) %>
            </p>

            <p>
                <%: Html.LabelFor(model => model.IsPickedup )%>
                <%: Html.DisplayFor(model => model.IsPickedup) %>
            </p>

            <h3>Return Details</h3>

            <p>
                <%: Html.LabelFor(model => model.ReturnAddress) %>
                <%: Html.DisplayFor(model => model.ReturnAddress) %>
            </p>

            <p>
                <%: Html.LabelFor(model => model.ReturnTime) %>
                <%: Html.DisplayFor(model => model.ReturnTime) %>
            </p>

            <p>
                <%: Html.LabelFor(model => model.IsReturned )%>
                <%: Html.DisplayFor(model => model.IsReturned) %>
            </p>

            <p>
                <%: Html.ActionLink("Edit", "Edit", new { id=Model.TransactionID }) %> |
                <%: Html.ActionLink("Back to Item", "Details", "Items", new { id=Model.ItemID}, null) %>
            </p>
        </div>
    </div>


    <div id="mapDiv">

    <% if ((Model.IsPostingUser(Context.User.Identity.Name) && !Model.HasFeedbackByPostingUser()) || (Model.IsTransactingUser(Context.User.Identity.Name) && !Model.HasFeedbackByTransactingUser())){ %>

        <div class="widget">
             
              <h3>Leave Feedback</h3>

            <% Html.RenderAction("Feedback", "Comments", new { type = Ditto.Models.Comment.CommentType.Transaction, subjectID = Model.TransactionID } ); %>

        </div>
    <%} else {%>

    <h3>Transaction Completed</h3>

    <%} %>
        <div class="widget">
              
            <p>
                <strong>Pickup at:</strong>
                <span class="location adr">
                    <span class="extended-address"><%: Model.PickupAddress %></span>
<%--                    <span class="country-name"><%: Model.Country %></span>--%>
                    <abbr class="geo" title="<%: Model.PickupLatitude %>;<%: Model.PickupLongitude %>" style="display: none;">Geolocation for hCalendar</abbr>
                </span>
            </p>

            <% Html.RenderPartial("map", Model.PickupLocation); %>

        </div>

        <div class="widget">
                
            <p>
                <strong>Return at:</strong>
                <span class="location adr">
                    <span class="extended-address"><%: Model.ReturnAddress %></span>
<%--                    <span class="country-name"><%: Model.Country %></span>--%>
                    <abbr class="geo" title="<%: Model.ReturnLatitude %>;<%: Model.ReturnLongitude %>" style="display: none;">Geolocation for hCalendar</abbr>
                </span>
            </p>

            <% Html.RenderPartial("map", Model.ReturnLocation); %>

        </div>

        <div class="widget">
            <% Html.RenderAction("Transaction", "Comments", new {transactionID = Model.TransactionID}); %>
        </div>



    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadArea" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="MastheadContent" runat="server">
</asp:Content>
